<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class PmChildProjectResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  Request              $request
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return [
            'id' => $this->id,
            'parent_id' => $this->parent_id,
            'project_name' => $this->project_name,
            'project_serial' => $this->project_serial,
            'periods' => $this->periods,
            'direct_donate_budget' => $this->direct_donate_budget,
            'activity_cost_budget' => $this->activity_cost_budget,
            'creator' => $this->creator,
            'creator_text' => $this->creator_text,
            'created_at' => $this->created_at->toDateTimeString(),
            'updated_at' => $this->updated_at->toDateTimeString(),
        ];
    }
}
